
cc.Class({
    extends: cc.Component,

    properties: {
        lb_idx: cc.Label,
        lb_username: cc.Label,
        lb_desc: cc.Label,
    },

    // LIFE-CYCLE CALLBACKS:
    ctor(){
        this.itemData = null;
    },


    initWithData(itemData,idx){
        this.itemData = itemData;
        this.lb_idx.string = idx + 1;
        this.lb_username.string = itemData.uname;
        this.lb_desc.string = itemData.desc;
    },

    btn_viewClicked(){
        cc.log('view clicked!');
        G.winMgr.showDetailLayer(this.itemData);
    },
});
